package com.tonann.app.service.impl;

import com.tonann.app.domain.AppFeedBack;
import com.tonann.app.mapper.AppFeedBackMapper;
import com.tonann.app.service.IAppFeedBackService;
import com.tonann.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 帮助与反馈Service业务层处理
 *
 * @author tonann
 * @date 2023-05-21
 */
@Service
public class AppFeedBackServiceImpl implements IAppFeedBackService {
    @Autowired
    private AppFeedBackMapper appFeedBackMapper;

    /**
     * 查询帮助与反馈
     *
     * @param id 帮助与反馈主键
     * @return 帮助与反馈
     */
    @Override
    public AppFeedBack selectAppFeedBackById(Long id) {
        return appFeedBackMapper.selectAppFeedBackById(id);
    }

    /**
     * 查询帮助与反馈列表
     *
     * @param appFeedBack 帮助与反馈
     * @return 帮助与反馈
     */
    @Override
    public List<AppFeedBack> selectAppFeedBackList(AppFeedBack appFeedBack) {
        return appFeedBackMapper.selectAppFeedBackList(appFeedBack);
    }

    /**
     * 新增帮助与反馈
     *
     * @param appFeedBack 帮助与反馈
     * @return 结果
     */
    @Override
    public int insertAppFeedBack(AppFeedBack appFeedBack) {
        appFeedBack.setCreateTime(DateUtils.getNowDate());
        return appFeedBackMapper.insertAppFeedBack(appFeedBack);
    }

    /**
     * 修改帮助与反馈
     *
     * @param appFeedBack 帮助与反馈
     * @return 结果
     */
    @Override
    public int updateAppFeedBack(AppFeedBack appFeedBack) {
        appFeedBack.setUpdateTime(DateUtils.getNowDate());
        return appFeedBackMapper.updateAppFeedBack(appFeedBack);
    }

    /**
     * 批量删除帮助与反馈
     *
     * @param ids 需要删除的帮助与反馈主键
     * @return 结果
     */
    @Override
    public int deleteAppFeedBackByIds(Long[] ids) {
        return appFeedBackMapper.deleteAppFeedBackByIds(ids);
    }

    /**
     * 删除帮助与反馈信息
     *
     * @param id 帮助与反馈主键
     * @return 结果
     */
    @Override
    public int deleteAppFeedBackById(Long id) {
        return appFeedBackMapper.deleteAppFeedBackById(id);
    }
}
